<?php
/**
 * Created by PhpStorm.
 * User: addd
 * Date: 2020/10/13
 * Time: 10:39
 */
namespace App\Admin\Selectable;

use App\Models\Storeys;
use Encore\Admin\Facades\Admin;
use Encore\Admin\Grid\Selectable;
use Encore\Admin\Grid\Filter;

class Storey extends Selectable
{
    public $model = Storeys::class;

    public function make()
    {
        $this->column('id');
        $this->column('name','楼层名称');
        $this->model()->where(['store_id'=> Admin::user()->store_id]);

        $this->filter(function (Filter $filter) {
            // 去掉默认的id过滤器
            $filter->disableIdFilter();
            $filter->like('name','楼层名称');
        });
    }


}
